/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 张宇田
 * Date: 2025-02-11
 * Time: 20:25
 */
public class Test {
    public static void main(String[] args){
        MyBinaryTree tree = new MyBinaryTree();
        MyBinaryTree.Node root = tree.myTree();
        tree.preOrder(root);
        int size = tree.getSize(root);
        System.out.println();
        System.out.println(size);
        int lsize = tree.getL1(root);
        System.out.println(lsize);

        int lsize2 = tree.getL2(root);
        System.out.println(lsize2);

        System.out.println("第k层节点数 ");
        int n = tree.getLevelNodeCount(root,2);
        System.out.println(n);

        System.out.println("获取 二 叉树的高度");
        int h = tree.getHeight(root);
        System.out.println(h);

        System.out.println("检测二叉树中是否有值k");
        MyBinaryTree.Node knod = tree.findKey(root,'D');
        System.out.println(knod.val);

        System.out.println("检查两棵树是否相同");
        MyBinaryTree tree2 = new MyBinaryTree();
        MyBinaryTree.Node root2 = new MyBinaryTree.Node('A');
        
        tree.isSame(root,root2);
    }
}

